package com.bysj.agent.config;

import dev.langchain4j.web.search.searchapi.SearchApiWebSearchEngine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class WebSearchConfig {

    @Bean
    public SearchApiWebSearchEngine searchApiWebSearchEngine() {
        Map<String, Object> optionalParameters = new HashMap<>();
        optionalParameters.put("gl", "us");
        optionalParameters.put("hl", "en");
        optionalParameters.put("google_domain", "google.com");
        return   SearchApiWebSearchEngine.builder()
                .apiKey("juPxNsHSXDSSBN2ovbJtfr34")
                .engine("google")
                .optionalParameters(optionalParameters)
                .build();
    }
}
